package com.zjj.learn.algorithmPlus.segment2.binaryTree;

/**
 * 平衡节点
 */
public class AVLNode<K extends Comparable<K>, V> {
    /**
     * 当前极点的key
     */
    K key;
    /**
     * 节点值
     */
    V data;
    /**
     * 当前节点的高度，默认为 1
     */
    int height = 1;

    AVLNode<K, V> left;
    AVLNode<K, V> right;

    public AVLNode(K key, V data) {
        this.key = key;
        this.data = data;
    }

    public AVLNode(K key, V data, AVLNode<K, V> left, AVLNode<K, V> right) {
        this.key = key;
        this.data = data;
        this.left = left;
        this.right = right;
    }
}